home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue39 / slimmer / D2.LOG next >
Encoding:
Text File  |  1998-09-09  |  1.8 KB  |  51 lines

  1. Turbo Debugger Log
  2.  
  3. In D2 the startup code in the EXE file explicitly calls the init-sections
  4. of units with explicit init/final code:
  5.  
  6. inittest.InitTest: begin
  7. :0041F4EC 55             push   ebp
  8. :0041F4ED 8BEC           mov    ebp,esp
  9. :0041F4EF 83C4F4         add    esp,FFFFFFF4
  10. :0041F4F2 E8753CFEFF     call   @InitExe
  11. :0041F4F7 E8904FFEFF     call   System
  12. :0041F4FC E83779FEFF     call   SysUtils
  13. :0041F501 E8C6E4FEFF     call   Classes
  14. :0041F506 E8ADE5FEFF     call   Printers
  15. :0041F50B E80805FFFF     call   Menus
  16. :0041F510 E82367FFFF     call   Controls
  17. :0041F515 E88EFFFFFF     call   Forms
  18. :0041F51A E8ADFFFFFF     call   TestInit
  19. inittest.10:  Application.Initialize;
  20. :0041F51F A128164200     mov    eax,[00421628]
  21. :0041F524 E877F6FFFF     call   TApplication.Initializ
  22.  
  23. In D2 the init code starts with a call to AddExitProc if the unit contains
  24. a finalization section. Otherwise on magic code is added.
  25.  
  26. TestInit: initialization
  27. :0041F4CC B8B0054200     mov    eax,004205B0
  28. :0041F4D1 E8D246FEFF     call   @AddExitProc
  29. testinit.19:  AutoGlobalP := pointer(longint(@UnitGlob
  30. :0041F4D6 B860164200     mov    eax,00421660
  31. :0041F4DB 83C004         add    eax,00000004
  32. :0041F4DE A35C164200     mov    [0042165C],eax
  33. testinit.20:  UnitGlobal := 0;
  34. :0041F4E3 33C0           xor    eax,eax
  35. :0041F4E5 A360164200     mov    [00421660],eax
  36. testinit.22: finalization
  37. :0041F4EA C3             ret
  38.  
  39. No magic code is added to the final section in D2:
  40.  
  41. testinit.finalization:  AutoGlobalP := pointer(longint
  42. :0041F4B4 B860164200     mov    eax,00421660
  43. :0041F4B9 83C004         add    eax,00000004
  44. :0041F4BC A35C164200     mov    [0042165C],eax
  45. testinit.28:  UnitGlobal := 0;
  46. :0041F4C1 33C0           xor    eax,eax
  47. :0041F4C3 A360164200     mov    [00421660],eax
  48. testinit.31: end.
  49. :0041F4C8 C3             ret
  50.  
  51.